//参数1，柱状图标题，参数2说明，参数3 y轴 说明，
function showBar(title,comment,ytitle,url){

	$.ajax({
		"url":url,
		"type":"get",
		"dataType":"json",
		"success":function (dto) {
			if (dto.code == 200){
				var charts = dto.tList;
				var chartItems = new Array();
				$(charts).each(function (i,chart) {
					var chartItem  = new ChartItem(chart.name,chart.value,chart.name+"  "+ chart.comment);
					chartItems.push(chartItem);
				}

			  );
				alert("111");
				showChart(chartItems);
			} else{
				alert("初始化图标失败");
				return;
			}
		}
	});


	function showChart(chartItems) {
		Highcharts.chart('container', {
			chart: {
				type: 'column'
			},
			title: {
				text: title
			},
			subtitle: {
				text: comment
			},
			xAxis: {
				type: 'category'
			},
			yAxis: {
				title: {
					text: ytitle
				}
			},
			legend: {
				enabled: false
			},
			plotOptions: {
				series: {
					borderWidth: 0,
					dataLabels: {//柱子上面显示数据
						enabled: true,
						format: '{point.y:.1f}%'
					}
				}
			},
			tooltip: {
				headerFormat: '<span style="font-size:11px">{series.name}</span><br>',
				pointFormat: '<span style="color:{point.color}">{point.name}</span>: <b>{point.y:.2f}%</b> of total<br/>'
			},
			series: [{
				name: '浏览器品牌',
				colorByPoint: true,
				data: chartItems
			}],
			//子统计图数据
			drilldown: {
				series: [{
					name: 'Microsoft Internet Explorer',
					id: 'Microsoft Internet Explorer',
					data: [
						[
							'v11.0',
							24.13
						],
						[
							'v8.0',
							17.2
						],
						[
							'v9.0',
							8.11
						],
						[
							'v10.0',
							5.33
						],
						[
							'v6.0',
							1.06
						],
						[
							'v7.0',
							0.5
						]
					]
				}]
			}
		});
	}
}
